/**
 * 
 */
package com.geezdata.cps.ttk.domain.factory;

import java.util.Date;

import com.geezdata.cps.base.utils.BeanUtil;
import com.geezdata.cps.ttk.common.request.CreateOrUpdateTaskItemRequest;
import com.geezdata.cps.ttk.common.vo.TaskItemReqVO;
import com.geezdata.cps.ttk.domain.domain.TaskItem;


/**
 * @author zheng
 *
 */
public class TaskItemFactory {
	public static TaskItem newInstance(CreateOrUpdateTaskItemRequest request) {
		TaskItemReqVO taskItemReqVO = request.getTaskItem();
		TaskItem taskItem = BeanUtil.convert(taskItemReqVO, TaskItem.class);
		
		Date now = new Date();
		taskItem.setCreatedAt(now );
		taskItem.setCreatedAt(now);
		taskItem.setCreatedUser(request.getCurrentUser());
		taskItem.setUpdatedUser(request.getCurrentUser());
		return taskItem;
	}
}
